const { defineConfig } = require('@vue/cli-service')
const path = require('path');
const {resolve} = path;

module.exports = defineConfig({
  transpileDependencies: true,

  configureWebpack: {
    module: {
      rules: [
        {
          test: /\.svg$/,
          use:[
            'svg-sprite-loader',
            'svgo-loader'
          ],
          include:[resolve(__dirname, 'src/assets/icons')]
         }
      ],
    },
    resolve:{
      alias: {
        '@': resolve(__dirname, 'src')
      },
      fallback:{
        path: require.resolve('path-browserify'),
      }
    }
  },

  chainWebpack: config => {
    config.module
        .rule('svg')
        .exclude.add(path.join(__dirname,'src/assets/icons'))
        .end();
  }
})
